#!/usr/bin/env python

import comm_pyevent as comm

def hook(msg, sender):
    if sender == 'timer':
        print 'peers:', comm.peers
        comm.timer('tick', 2)
    else:
        print 'svr rcvd:', msg, sender
        comm.send('x' * 65535, sender)

comm.init(hook, 10061)


comm.timer('tick', 2)
comm.start()
